import React from 'react'
import { Redirect } from 'react-router-dom'
import Discover from '../pages/discover'
import album from '../pages/discover/c-pages/album'
import artist from '../pages/discover/c-pages/artist'
import djradio from '../pages/discover/c-pages/djradio'
import Ranking from '../pages/discover/c-pages/ranking'
import recommend from '../pages/discover/c-pages/recommend'
import Songs from '../pages/discover/c-pages/songs'
import Friends from '../pages/firends'
import Mine from '../pages/mime'
import NotFind from '../pages/notFind'

const routes = [
  {
    path: '/',
    exact: true,
    render: () => <Redirect to={'/discover'} />,
  },
  {
    path: '/discover',
    component: Discover,
    routes: [
      {
        path: '/discover',
        exact: true,
        render: () => <Redirect to={'/discover/recommend'} />,
      },
      {
        path: '/discover/recommend',
        component: recommend,
      },
      {
        path: '/discover/ranking',
        component: Ranking,
      },
      {
        path: '/discover/songs',
        component: Songs,
      },
      {
        path: '/discover/djradio',
        component: djradio,
      },
      {
        path: '/discover/artist',
        component: artist,
      },
      {
        path: '/discover/album',
        component: album,
      },
    ],
  },
  {
    path: '/mine',
    component: Mine,
    exact: true,
  },
  {
    path: '/friend',
    component: Friends,
  },
  {
    component: NotFind,
  },
]
export default routes
